home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / source / uPostURL.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2005-01-26  |  981 b   |  48 lines

  1. unit uPostURL;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, TntStdCtrls;
  8.  
  9. type
  10.   TfrmBookmark = class(TForm)
  11.     Button1: TButton;
  12.     Button2: TButton;
  13.     Label1: TLabel;
  14.     Edit1: TTnTEdit;
  15.     Label2: TLabel;
  16.     Memo: TTnTMemo;
  17.     procedure Button1Click(Sender: TObject);
  18.     procedure FormCreate(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24.  
  25. var
  26.   frmBookmark: TfrmBookmark;
  27.  
  28. implementation
  29.  
  30. {$R *.dfm}
  31.  
  32. procedure TfrmBookmark.Button1Click(Sender: TObject);
  33. begin
  34.   if Trim(Edit1.Text) = '' then
  35.     raise Exception.Create('You must specify a title');
  36.   if Trim(Memo.Text) = '' then
  37.     raise Exception.Create('You must specify an URL');
  38.   ModalResult := mrOk;
  39. end;
  40.  
  41. procedure TfrmBookmark.FormCreate(Sender: TObject);
  42. begin
  43.   Memo.Text := 'http://';
  44.   Memo.SelStart := Length(Memo.Text);
  45. end;
  46.  
  47. end.
  48.